/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Behavioral.Iterator;

import java.util.Iterator;

/**
 *
 * @author Demoni
 */
public class CarreraIterator implements Iterator<Alumno> {
    private Alumno[] Alumno;
    private int location = 0;
    public CarreraIterator(Alumno[] e){
        Alumno = e;
    }

    @Override
    public boolean hasNext() {
        if(location< Alumno.length && Alumno[location]!= null)
        {
            return true;
        }
        else{
            return false;
        }
    }

    @Override
    public Behavioral.Iterator.Alumno next() {
       return Alumno[location++];
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
        
}
